﻿package mortal.game.view.guild.tabpanel
{
    import Message.DB.Tables.*;
    import Message.Game.*;
    import Message.Public.*;
    import __AS3__.vec.*;
    import com.gengine.utils.*;
    import com.mui.controls.*;
    import com.mui.manager.*;
    import com.mui.utils.*;
    import extend.language.*;
    import flash.display.*;
    import flash.events.*;
    import flash.text.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.game.cache.*;
    import mortal.game.cache.guild.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.utils.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.display.*;
    import mortal.game.view.common.guide.*;
    import mortal.game.view.guild.buildingPanel.*;
    import mortal.game.view.guild.otherpanel.*;
    import mortal.game.view.rebate.item.*;
    import mortal.mvc.core.*;

    public class GuildInfoPanel extends GuildBasePanel
    {
        private var _bmpTxtGuildLevel:BitmapNumberText;
        private var _btnApplyList:GButton;
        private var _btnUpGradeCamp:GButton;
        private var _bmpApply:GBitmap;
        private var _txtApplyNum:GTextFiled;
        private var _txtGuildName:GTextFiled;
        private var _txtGuildInfoDesc:GTextFiled;
        private var _txtQQ:GTextInput;
        private var _txtGuildPurpose:GTextInput;
        private var _btnImpeachLeader:GButton;
        private var _btnContributionsDonate:GButton;
        private var _txtSelfPosition:GTextFiled;
        private var _txtSelfContribution:GTextFiled;
        private var _txtSelfRes:GTextFiled;
        private var _txtSelfWeekContribution:GTextFiled;
        private var _txtSelfWeekActive:GTextFiled;
        private var _txtGuidlGift:GTextFiled;
        private var _giftCell:RebateItem;
        private var _giftGetBtn:GButton;
        private var _giftTips:GTextFiled;
        private var _gardenX:int = 6808;
        private var _gardenY:int = 3495;
        private var _btnGuildTerritory:GLoadedButton;
        private var _btnGuildOtherTerriory:GLoadedButton;
        private var _btnGuildExcavate:GLoadedButton;
        private var _btnGuildShop:GLoadedButton;
        private var _iconGuildDonate:GLoadedButton;
        private var _iconGuildMail:GLoadedButton;
        private var _iconGuildBoss:GLoadedButton;
        private var _iconGuildCopy:GLoadedButton;
        private var _iconGuildWarehouse:GLoadedButton;
        private var _iconGuildGarden:GLoadedButton;
        private var _iconGuildUnion:GLoadedButton;
        private var _iconGuildFeast:GLoadedButton;
        private var _iconGuildGodTree:GLoadedButton;
        private var _iconGuildTaskLuck:GLoadedButton;
        private var _toolTipWareHouseWarn:ToolTipSprite;
        private var _bmpWareHouseWarn:GBitmap;
        private var _txtWareHouseWarn:GTextFiled;
        private var _txtAllApplyNum:GTextFiled;
        private var _bgAllApplyNum:GBitmap;

        public function GuildInfoPanel()
        {
            super(ResFileConst.guildInfoPanel);
            return;
        }// end function

        override public function layoutUI() : void
        {
            var x:int;
            var y:int;
            var icon:GBitmap;
            UIFactory.gBitmap(ImagesConst.guildInfoBg, 18, 69, this);
            UIFactory.gBitmap(ImagesConst.guildLevelBg, 50, 86, this);
            this._bmpTxtGuildLevel = UIFactory.bitmapNumberText(103, 112, "StrengthenNumber.png", 32, 40, -6, this);
            this._bmpTxtGuildLevel.text = "1";
            var textFormat2:* = GlobalStyle.textFormatItemGreen;
            textFormat2.align = "center";
            this._txtGuildName = UIFactory.gTextField("", 58, 182, 150, 24, this, textFormat2);
            var guildInfoDescTitle:* = Language.getString(60020) + "：\n" + Language.getString(60021) + "：\n" + Language.getString(60022) + "：\n" + Language.getString(60024) + "：\n" + Language.getString(60025) + "：\n";
            var textFormat3:* = GlobalStyle.textFormatChen;
            textFormat3.leading = 6;
            UIFactory.gTextField(guildInfoDescTitle, 25, 215, 60, 140, this, textFormat3);
            var textFormat4:* = GlobalStyle.textFormatPutong;
            textFormat4.leading = 6;
            var guildInfoDesc:* = "\n" + "0\n" + "0/0\n" + "0" + Language.getString(71304) + "0\n";
            this._txtGuildInfoDesc = UIFactory.gTextField(guildInfoDesc, 87, 215, 130, 140, this, textFormat4);
            this._btnImpeachLeader = UIFactory.gButton("" + Language.getString(71305), 172, 215, 62, 24, this);
            this._btnApplyList = UIFactory.gButton(Language.getString(60007), 172, 255, 62, 24, this);
            this._bmpApply = UIFactory.gBitmap(ImagesConst.NumberBg, 218, 245, this);
            this._btnUpGradeCamp = UIFactory.gButton(Language.getString(60008), 172, 284, 62, 24);
            var textFormat5:* = GlobalStyle.textFormatItemWhite;
            textFormat5.size = 14;
            this._txtApplyNum = UIFactory.gTextField("0", 221, 247, 24, 24, this, textFormat5);
            UIFactory.bg(87, 303, 149, 26, this);
            this._txtQQ = this.createTextInput(87, 305, 120, 22, this);
            this._txtQQ.restrict = "0-9";
            this._txtQQ.maxChars = 11;
            this._txtQQ.configEventListener(FocusEvent.FOCUS_IN, this.onTxtFocusIn);
            UIFactory.bg(25, 355, 212, 123, this, ImagesConst.guildNoticeBg);
            UIFactory.gTextField(Language.getString(60006), 101, 360, 60, 24, this, GlobalStyle.textFormatAnjin);
            this._txtGuildPurpose = this.createTextInput(36, 390, 188, 78, this);
            this._txtGuildPurpose.maxChars = 50;
            this._txtGuildPurpose.configEventListener(FocusEvent.FOCUS_IN, this.onTxtFocusIn);
            UIFactory.bg(251, 69, 468, 185, this);
            UIFactory.bg(251, 69, 468, 26, this, ImagesConst.RegionTitleBg);
            UIFactory.gBitmap(ImagesConst.guildPlayerInfoTitle, 455, 75, this);
            var postionIntroduceLink:* = "<a href=\'event:positionInroduce\' target = \'\'><font color=\'#00ff00\'><u>" + Language.getString(60015) + "</u></font></a>";
            var txtPostionIntroduceLink:* = UIFactory.gTextField(postionIntroduceLink, 650, 100, 60, 20, this, null, true);
            var onOpenPositionIntroducePanel:* = function (event:TextEvent) : void
            {
                GuildPositonIntroducePanel.instance.popUp();
                return;
            }// end function
            ;
            txtPostionIntroduceLink.configEventListener(TextEvent.LINK, onOpenPositionIntroducePanel);
            this._txtSelfPosition = UIFactory.gTextField(HTMLUtil.addColor(Language.getString(60009), GlobalStyle.colorAnjin), 260, 100, 130, 20, this, null, true);
            this._txtSelfContribution = UIFactory.gTextField(HTMLUtil.addColor(Language.getString(60010), GlobalStyle.colorAnjin), 260, 120, 130, 20, this, null, true);
            this._txtSelfContribution.toolTipData = Language.getString(70624);
            this._txtSelfWeekActive = UIFactory.gTextField(HTMLUtil.addColor(Language.getString(60013), GlobalStyle.colorAnjin), 260, 140, 130, 20, this, null, true);
            this._txtSelfWeekActive.toolTipData = Language.getString(70625);
            var selfWeekContributionHtml:* = "<font color=\'#ffc293\'>" + Language.getString(60012) + "：</font>" + "<font color=\'#00ff00\'>0</font>";
            this._txtSelfWeekContribution = UIFactory.gTextField(selfWeekContributionHtml, 260, 160, 130, 20, this, null, true);
            this._txtSelfWeekContribution.toolTipData = Language.getString(70626);
            this._txtGuidlGift = UIFactory.gTextField(HTMLUtil.addColor("" + Language.getString(71306), GlobalStyle.colorAnjin), 260, 209, 130, 20, this, null, true);
            this._giftCell = UIFactory.getUICompoment(RebateItem, 327, 180, this);
            this._giftGetBtn = UIFactory.gButton("" + Language.getString(71307), 410, 208, 62, 24, this);
            this._giftGetBtn.configEventListener(MouseEvent.CLICK, this.onGetGiftHd);
            this._giftGetBtn.toolTipData = "" + Language.getString(71308);
            this._giftTips = UIFactory.gTextField("" + Language.getString(71309), 480, 204, 170, 45, this, null, true);
            var _loc_2:Boolean = true;
            this._giftTips.wordWrap = true;
            this._giftTips.multiline = _loc_2;
            this._txtSelfRes = UIFactory.gTextField(HTMLUtil.addColor(Language.getString(60011), GlobalStyle.colorAnjin), 377, 185, 130, 20, this, null, true);
            this._btnContributionsDonate = UIFactory.gButton(Language.getString(60016), 644, 125, 62, 24, this);
            UIFactory.bg(251, 260, 468, 227, this);
            UIFactory.bg(251, 260, 468, 26, this, ImagesConst.RegionTitleBg);
            UIFactory.gBitmap(ImagesConst.guildFunctionTitle, 455, 268, this);
            this._btnGuildTerritory = UIFactory.gLoadedButton(ImagesConst.guildTerritory_upSkin, 0, 288, 111, 44, this);
            this._btnGuildTerritory.name = "guild_enterSelfGuildBtn";
            this._btnGuildOtherTerriory = UIFactory.gLoadedButton(ImagesConst.guildOtherTerritory_upSkin, 0, 288, 111, 44, this);
            this._btnGuildExcavate = UIFactory.gLoadedButton(ImagesConst.guildExcavate_upSkin, 0, 288, 111, 44, this);
            this._btnGuildShop = UIFactory.gLoadedButton(ImagesConst.guildShop_upSkin, 0, 288, 111, 44, this);
            var btnGuildFunctionList:* = new Vector.<GLoadedButton>;
            btnGuildFunctionList.push(this._btnGuildTerritory, this._btnGuildOtherTerriory, this._btnGuildExcavate, this._btnGuildShop);
            var imagesListOne:* = new Vector.<String>;
            imagesListOne.push(ImagesConst.guildTerritory_upSkin, ImagesConst.guildOtherTerritory_upSkin, ImagesConst.guildExcavate_upSkin, ImagesConst.guildShop_upSkin);
            var i:int;
            while (i < btnGuildFunctionList.length)
            {
                
                btnGuildFunctionList[i].x = 257 + 115 * i;
                i = (i + 1);
            }
            var iconGuildFunctionList:* = new Vector.<GLoadedButton>;
            this._iconGuildDonate = UIFactory.gLoadedButton(ImagesConst.guildFunction_upSkin, 0, 0, 69, 69, this);
            this._iconGuildMail = UIFactory.gLoadedButton(ImagesConst.guildFunction_upSkin, 0, 0, 69, 69, this);
            this._iconGuildBoss = UIFactory.gLoadedButton(ImagesConst.guildFunction_upSkin, 0, 0, 69, 69, this);
            this._iconGuildCopy = UIFactory.gLoadedButton(ImagesConst.guildFunction_upSkin, 0, 0, 69, 69, this);
            this._iconGuildWarehouse = UIFactory.gLoadedButton(ImagesConst.guildFunction_upSkin, 0, 0, 69, 69, this);
            this._iconGuildGarden = UIFactory.gLoadedButton(ImagesConst.guildFunction_upSkin, 0, 0, 69, 69, this);
            this._iconGuildUnion = UIFactory.gLoadedButton(ImagesConst.guildFunction_upSkin, 0, 0, 69, 69, this);
            this._iconGuildFeast = UIFactory.gLoadedButton(ImagesConst.guildFunction_upSkin, 0, 0, 69, 69, this);
            this._iconGuildGodTree = UIFactory.gLoadedButton(ImagesConst.guildFunction_upSkin, 0, 0, 69, 69, this);
            this._iconGuildTaskLuck = UIFactory.gLoadedButton(ImagesConst.guildFunction_upSkin, 0, 0, 69, 69, this);
            iconGuildFunctionList.push(this._iconGuildBoss, this._iconGuildGodTree, this._iconGuildFeast, this._iconGuildCopy, this._iconGuildGarden, this._iconGuildDonate, this._iconGuildMail, this._iconGuildWarehouse, this._iconGuildUnion, this._iconGuildTaskLuck);
            var imagesListTwo:* = new Vector.<String>;
            imagesListTwo.push(ImagesConst.guildBoss, ImagesConst.guildTree, ImagesConst.guildFeast, ImagesConst.guildCopy, ImagesConst.guildGarden, ImagesConst.guildDonate, ImagesConst.guildMail, ImagesConst.guildWarehouse, ImagesConst.guildUnion, ImagesConst.guildTaskLuck);
            var j:int;
            while (j < iconGuildFunctionList.length)
            {
                
                x = 290 + j % 5 * 80;
                y = j >= 5 ? (412) : (340);
                iconGuildFunctionList[j].x = x;
                iconGuildFunctionList[j].y = y;
                icon = UIFactory.gBitmap(imagesListTwo[j], x, (y + 1), this);
                j = (j + 1);
            }
            this._toolTipWareHouseWarn = UICompomentPool.getUICompoment(ToolTipSprite);
            this._toolTipWareHouseWarn.mouseEnabled = true;
            UIFactory.setObjAttri(this._toolTipWareHouseWarn, 375, 411, 62, 24, this);
            this._toolTipWareHouseWarn.toolTipData = "xxxxxxxxxxxxxx";
            this._bmpWareHouseWarn = UIFactory.gBitmap(ImagesConst.NumberBg, 0, 0, this._toolTipWareHouseWarn);
            this._txtWareHouseWarn = UIFactory.textField("5", 5, 0, 22, 22, this._toolTipWareHouseWarn);
            this._toolTipWareHouseWarn.visible = false;
            this._bgAllApplyNum = UIFactory.gBitmap(ImagesConst.NumberBg, 493, 415, this);
            this._bgAllApplyNum.visible = false;
            this._txtAllApplyNum = UIFactory.gTextField("99", 493, 415, 24, 22, this, GlobalStyle.textFormatBai.center());
            this._txtAllApplyNum.visible = false;
            Dispatcher.dispatchEvent(new DataEvent(EventName.GUILD_INFO_GET));
            if (!Cache.instance.guild.selfGuildInfo.wareHouse.hasItemData)
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.Guild_wareHouse_getData));
            }
            this.onWareHouseAllApplyNumUpdate();
            NetDispatcher.addCmdListener(ServerCommand.GuildWareHouseAllApplyNumUpdate, this.onWareHouseAllApplyNumUpdate);
            return;
        }// end function

        private function onWareHouseAllApplyNumUpdate(param1:Object = null) : void
        {
            this._txtAllApplyNum.text = Cache.instance.guild.selfGuildInfo.wareHouse.allApplyNum.toString();
            this._txtAllApplyNum.visible = Cache.instance.guild.selfGuildInfo.wareHouse.allApplyNum > 0;
            this._bgAllApplyNum.visible = Cache.instance.guild.selfGuildInfo.wareHouse.allApplyNum > 0;
            return;
        }// end function

        private function onGetGiftHd(event:MouseEvent) : void
        {
            GameProxy.guild.getDayReward();
            return;
        }// end function

        override public function update() : void
        {
            var _loc_5:SPlayerItem = null;
            var _loc_1:* = Cache.instance.guild.selfGuildInfo;
            if (_loc_1.baseInfo == null)
            {
                return;
            }
            this._bmpTxtGuildLevel.text = _loc_1.baseInfo.level.toString();
            if (_loc_1.baseInfo.level < 10)
            {
                this._bmpTxtGuildLevel.x = 116;
            }
            else
            {
                this._bmpTxtGuildLevel.x = 103;
            }
            this._txtApplyNum.text = _loc_1.applyNum.toString();
            this._txtGuildName.text = _loc_1.baseInfo.guildName;
            var _loc_2:int = 0;
            this._txtGuildInfoDesc.text = _loc_1.baseInfo.leader.name + "\n" + _loc_1.baseInfo.rank + "\n" + _loc_1.baseInfo.playerNum + "/" + _loc_1.baseInfo.maxPlayerNum + "\n" + _loc_1.baseInfo.resource;
            this._txtQQ.text = _loc_1.baseInfo.QQ;
            this._txtGuildPurpose.text = _loc_1.baseInfo.purpose;
            this._txtQQ.editable = GuildConst.hasPermissions(GuildConst.ChangeGuildQQYY);
            this._txtGuildPurpose.editable = GuildConst.hasPermissions(GuildConst.ChangePurpose);
            this._btnGuildExcavate.styleName = GuildConst.hasPermissions(GuildConst.FindingTalent) ? (ImagesConst.guildExcavate_upSkin) : (ImagesConst.guildList_upSkin);
            this._txtSelfPosition.htmlText = "<font color=\'#ffc293\'>" + Language.getString(60009) + "：</font>" + "<font color=\'" + GameDefConfig.instance.getItem("EGuildPostion", _loc_1.selfInfo.position).text1 + "\'>" + GameDefConfig.instance.getItem("EGuildPostion", _loc_1.selfInfo.position).text + "</font>";
            this._txtSelfContribution.htmlText = "<font color=\'#ffc293\'>" + Language.getString(60010) + "：</font>" + "<font color=\'#ffffff\'>" + _loc_1.selfInfo.contribution + "</font>";
            this._txtSelfRes.htmlText = "<font color=\'#ffc293\'>" + Language.getString(60011) + "：</font>" + "<font color=\'#ffffff\'>" + _loc_1.selfInfo.resource + "</font>";
            this._txtSelfWeekContribution.htmlText = "<font color=\'#ffc293\'>" + Language.getString(60012) + "：</font>" + "<font color=\'#00ff00\'>" + _loc_1.selfInfo.contributionWeek + "</font>";
            this._txtSelfWeekActive.htmlText = "<font color=\'#ffc293\'>" + Language.getString(60013) + "：</font>" + "<font color=\'#00ff00\'>" + _loc_1.baseInfo.activity + "</font>";
            var _loc_3:* = _loc_1.wareHouse.totalGrid - _loc_1.wareHouse.warehouseItemVec.length;
            if (_loc_3 <= 5)
            {
                this._txtWareHouseWarn.text = _loc_3.toString();
                this._toolTipWareHouseWarn.toolTipData = Language.getStringByParam(71310, _loc_3);
                this._toolTipWareHouseWarn.visible = true;
            }
            else
            {
                this._toolTipWareHouseWarn.visible = false;
            }
            this._txtSelfRes.visible = _loc_1.selfInfo.position == EGuildPosition._EGuildBranchMember;
            this._btnImpeachLeader.visible = GuildConst.CanImpeachLeader;
            var _loc_6:* = GuildConst.hasPermissions(GuildConst.ApproveIntoGuild) && _loc_1.applyNum > 0;
            this._txtApplyNum.visible = GuildConst.hasPermissions(GuildConst.ApproveIntoGuild) && _loc_1.applyNum > 0;
            this._bmpApply.visible = _loc_6;
            this._btnApplyList.visible = GuildConst.hasPermissions(GuildConst.ApproveIntoGuild);
            var _loc_4:* = GuildLevelTargetConfig.instance.getInfoByLevel(_loc_1.baseInfo.level).dayAward;
            if (_loc_4 != 0)
            {
                this._giftCell.visible = true;
                this._giftGetBtn.visible = true;
                this._giftTips.visible = true;
                _loc_5 = new SPlayerItem();
                _loc_5.itemCode = _loc_4;
                this._giftCell.updateInfo(_loc_5);
                if (_loc_1.selfInfo.dayAward == false)
                {
                    this._giftGetBtn.enabled = true;
                    this._giftCell.showEffect(true);
                    EffectManager.glowFilterReg(this._giftGetBtn, [FilterConst.chatTipsFilter], 0.6, 20, 2, 0);
                }
                else
                {
                    this._giftGetBtn.enabled = false;
                    this._giftCell.showEffect(false);
                    EffectManager.glowFilterUnReg(this._giftGetBtn);
                }
            }
            else
            {
                this._giftCell.visible = false;
                this._giftGetBtn.visible = false;
                this._giftTips.visible = false;
            }
            if (AutoGuideRedPoint2.instance.getValueByName(AutoGuideRedPoint2.GuildGarden))
            {
                EffectManager.glowFilterReg(this._iconGuildGarden, [FilterConst.chatTipsFilter], 0.6, 20, 2, 0);
            }
            else
            {
                EffectManager.glowFilterUnReg(this._iconGuildGarden);
            }
            this.updateOpenGuildDefenseCopyBtn();
            return;
        }// end function

        private function onTxtFocusIn(event:FocusEvent) : void
        {
            if (event.currentTarget == this._txtQQ)
            {
                this._txtQQ.configEventListener(FocusEvent.FOCUS_OUT, this.onTxtFocusOut);
            }
            else if (event.currentTarget == this._txtGuildPurpose)
            {
                this._txtGuildPurpose.configEventListener(FocusEvent.FOCUS_OUT, this.onTxtFocusOut);
            }
            return;
        }// end function

        private function onTxtFocusOut(event:FocusEvent) : void
        {
            var _loc_2:Object = null;
            if (event.currentTarget == this._txtQQ)
            {
                _loc_2 = {};
                _loc_2.operType = EOperOption._EOperOptionQQ;
                _loc_2.numStr = this._txtQQ.text;
                Dispatcher.dispatchEvent(new DataEvent(EventName.GUILD_CHANGE_QQYY, _loc_2));
            }
            else if (event.currentTarget == this._txtGuildPurpose)
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.GUILD_PURPOSE_CHANGE, this._txtGuildPurpose.text));
            }
            return;
        }// end function

        override public function onMouseClick(event:MouseEvent) : void
        {
            var _loc_2:* = Cache.instance.guild.selfGuildInfo;
            switch(event.target)
            {
                case this._btnApplyList:
                {
                    if (_loc_2.applyNum == 0)
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71311));
                        return;
                    }
                    GuildApplyListPanel.instance.popUp();
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GUILD_APPLY_LIST_GET, null));
                    break;
                }
                case this._btnUpGradeCamp:
                {
                    this.onClickUpdaGradeCamp();
                    break;
                }
                case this._btnContributionsDonate:
                {
                    GuildDonateResource.instance.popUp();
                    break;
                }
                case this._btnImpeachLeader:
                {
                    GuildImpeachLeaderPanel.instance.popUp();
                    break;
                }
                case this._btnGuildTerritory:
                {
                    if (Cache.instance.group.isInGroup)
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71312));
                        return;
                    }
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Guild_enterManor, _loc_2.baseInfo.guildId));
                    break;
                }
                case this._btnGuildOtherTerriory:
                {
                    if (_loc_2.baseInfo.level < 2)
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71313));
                        return;
                    }
                    GuildListPanel.PanelType = 1;
                    GuildListPanel.instance.popUp();
                    GuildListPanel.instance.filterFullMemberGuildVisible = false;
                    break;
                }
                case this._btnGuildExcavate:
                {
                    GuildListPanel.PanelType = 0;
                    GuildListPanel.instance.popUp();
                    if (GuildConst.hasPermissions(GuildConst.FindingTalent))
                    {
                        GuildListPanel.instance.filterFullMemberGuildVisible = false;
                    }
                    break;
                }
                case this._btnGuildShop:
                {
                    if (GuildBuildingConfig.instance.getInfoByBuildingType(_loc_2.baseInfo.level, EGuildStructureType._EGuildShop).structureLevel <= 0)
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71314));
                        return;
                    }
                    GuildShopPanel.instance.popUp();
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildShopGetItem));
                    break;
                }
                case this._iconGuildBoss:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildActivityShow));
                    break;
                }
                case this._iconGuildDonate:
                {
                    GuildDonateResource.instance.popUp();
                    break;
                }
                case this._iconGuildMail:
                {
                    if (_loc_2.baseInfo.level < 2)
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71315));
                        return;
                    }
                    if (!GuildConst.hasPermissions(GuildConst.SendGuildMail))
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71316));
                        return;
                    }
                    GuildMailPanel.instance.popUp();
                    break;
                }
                case this._iconGuildCopy:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildDefenseWinOpen));
                    break;
                }
                case this._iconGuildGarden:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildGotoGarden));
                    AutoGuideRedPoint2.instance.setValueByName(AutoGuideRedPoint2.GuildGarden, false);
                    if (this._iconGuildGarden)
                    {
                        EffectManager.glowFilterUnReg(this._iconGuildGarden);
                    }
                    break;
                }
                case this._iconGuildFeast:
                {
                    GameController.copy.winePartyCopy.view.show();
                    break;
                }
                case this._iconGuildGodTree:
                {
                    if (GuildBuildingConfig.instance.getInfoByBuildingType(_loc_2.baseInfo.level, EGuildStructureType._EGuildTree).structureLevel <= 0)
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71317));
                        return;
                    }
                    GuildGodTreePanel.instance.popUp();
                    break;
                }
                case this._iconGuildTaskLuck:
                {
                    if (Cache.instance.role.entityInfo.level >= GameDefConfig.instance.getSystemOpenLevel(43))
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.MiningShowModule, true));
                    }
                    else
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71318));
                    }
                    break;
                }
                case this._iconGuildWarehouse:
                {
                    if (GuildBuildingConfig.instance.getInfoByBuildingType(_loc_2.baseInfo.level, EGuildStructureType._EGuildWareHouse).structureLevel <= 0)
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71319));
                        return;
                    }
                    if (GuildConst.hasPermissions(GuildConst.OpenWareHouse))
                    {
                        LayerManager.windowLayer.tweenCenterWindow(GuildWareHousePanel.instance, GameController.pack.view);
                    }
                    else
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71320));
                    }
                    break;
                }
                case this._iconGuildUnion:
                {
                    MsgManager.showRollTipsMsg("" + Language.getString(71321));
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        private function enteredGuildAndMove(param1:Object = null) : void
        {
            return;
        }// end function

        private function onClickUpdaGradeCamp() : void
        {
            var config:TGuildCampTarget;
            var onSelect:Function;
            onSelect = function (param1:int) : void
            {
                var _loc_2:EUpgradeMode = null;
                if (param1 == Alert.OK)
                {
                    if (Cache.instance.guild.selfGuildInfo.baseInfo.resource < config.needResource)
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71328));
                        return;
                    }
                    _loc_2 = EUpgradeMode.convert(EUpgradeMode._EUpgradeResource);
                }
                else if (param1 == Alert.CANCEL)
                {
                    if (!Cache.instance.role.enoughMoney(EPriceUnit._EPriceUnitGold, config.needMoney))
                    {
                        MsgManager.showRollTipsMsg("" + Language.getString(71329));
                        return;
                    }
                    _loc_2 = EUpgradeMode.convert(EUpgradeMode._EUpgradeMoney);
                }
                else
                {
                    return;
                }
                Dispatcher.dispatchEvent(new DataEvent(EventName.GUILD_CAMP_LEVEL_UP, _loc_2));
                return;
            }// end function
            ;
            var curLv:* = Cache.instance.guild.selfGuildInfo.baseInfo.campLevel;
            config = GuildCampConfig.instance.getConfig((curLv + 1));
            if (config == null)
            {
                MsgManager.showRollTipsMsg("" + Language.getString(71322));
                return;
            }
            Alert.okLabel = "" + Language.getString(71323);
            Alert.calcelLabel = "" + Language.getString(71324);
            Alert.buttonWidth = 65;
            Alert.showCloseBtn = true;
            var resourceStr:* = HTMLUtil.addColor(config.needResource + Language.getString(71325), GlobalStyle.colorHuang2);
            var moneyStr:* = HTMLUtil.addColor(Language.getStringByParam(71326, config.needMoney), GlobalStyle.colorHuang2);
            var str:* = Language.getStringByParam(71327, ((curLv + 1)).toString(), resourceStr, moneyStr);
            Alert.show(str, null, Alert.OK | Alert.CANCEL, null, onSelect);
            return;
        }// end function

        private function updateOpenGuildDefenseCopyBtn() : void
        {
            if (CopyUtil.isCanOpenGuildDefenseCopy)
            {
                EffectManager.glowFilterReg(this._iconGuildCopy, [FilterConst.chatTipsFilter], 0.6, 20, 2, 0);
            }
            else
            {
                EffectManager.glowFilterUnReg(this._iconGuildCopy);
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            if (this._iconGuildGodTree)
            {
                EffectManager.glowFilterUnReg(this._iconGuildGodTree);
            }
            if (this._iconGuildCopy)
            {
                EffectManager.glowFilterUnReg(this._iconGuildCopy);
            }
            super.disposeImpl(param1);
            NetDispatcher.removeCmdListener(ServerCommand.GuildWareHouseAllApplyNumUpdate, this.onWareHouseAllApplyNumUpdate);
            if (this._bmpWareHouseWarn)
            {
                this._bmpWareHouseWarn.dispose(param1);
            }
            if (this._txtWareHouseWarn)
            {
                this._txtWareHouseWarn.dispose(param1);
            }
            this._bmpWareHouseWarn = null;
            this._txtWareHouseWarn = null;
            this._giftGetBtn = null;
            this._btnApplyList = null;
            this._btnUpGradeCamp = null;
            this._btnImpeachLeader = null;
            this._btnContributionsDonate = null;
            return;
        }// end function

        public function createTextInput(param1:int, param2:int, param3:int, param4:int, param5:DisplayObjectContainer) : GTextInput
        {
            var _loc_6:* = UIFactory.gTextInput();
            UIFactory.setObjAttri(_loc_6, param1, param2, param3, param4, this);
            var _loc_7:* = new Bitmap();
            _loc_6.setStyle("upSkin", _loc_7);
            _loc_6.setStyle("disabledSkin", _loc_7);
            _loc_6.setStyle("textFormat", GlobalStyle.textFormatPutong);
            _loc_6.setStyle("focusRectSkin", "");
            _loc_6.textField.filters = [FilterConst.glowFilter];
            return _loc_6;
        }// end function

        public function get iconGuildGodTree() : GLoadedButton
        {
            return this._iconGuildGodTree;
        }// end function

    }
}
